package com.xzsoft.gdwz.controller;

import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

@Component("cacheTest")
public class CacheTest {

	public static void main(String[] args) {
		
		CacheTest ct = new CacheTest();
		String old = ct.getCache("longbenhua");
		System.out.println(old);
		
		String ne = ct.putCache("longbenhua");
		System.out.println(ne);
		
		old = ct.getCache("longbenhua");
		System.out.println(old);
	}
	
	@Cacheable(value="emToken",key = "#old")
	public String getCache(String old){
		return old+"1234567890";
	}
	
	@CachePut(value="emToken",key = "#old")
	public String putCache(String old){
		return old+"0987654321";
	}
}
